from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(800, 650)  # 增加窗口高度
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        
        # 分类复选框布局调整
        self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
        self.groupBox.setGeometry(QtCore.QRect(20, 20, 751, 150))  # 增加高度
        
        # 第一行分类
        self.cb_anime = QtWidgets.QCheckBox(self.groupBox)
        self.cb_anime.setGeometry(QtCore.QRect(20, 30, 70, 20))
        self.cb_anime.setText("动漫")
        
        self.cb_ocean = QtWidgets.QCheckBox(self.groupBox)
        self.cb_ocean.setGeometry(QtCore.QRect(100, 30, 70, 20))
        self.cb_ocean.setText("海洋")
        
        self.cb_biglink = QtWidgets.QCheckBox(self.groupBox)
        self.cb_biglink.setGeometry(QtCore.QRect(180, 30, 70, 20))
        self.cb_biglink.setText("大图")
        
        self.cb_travel = QtWidgets.QCheckBox(self.groupBox)
        self.cb_travel.setGeometry(QtCore.QRect(260, 30, 70, 20))
        self.cb_travel.setText("旅行")
        
        # 第二行分类
        self.cb_food = QtWidgets.QCheckBox(self.groupBox)
        self.cb_food.setGeometry(QtCore.QRect(20, 60, 90, 20))
        self.cb_food.setText("美食饮品")
        
        self.cb_nature = QtWidgets.QCheckBox(self.groupBox)
        self.cb_nature.setGeometry(QtCore.QRect(120, 60, 70, 20))
        self.cb_nature.setText("自然")
        
        self.cb_architecture = QtWidgets.QCheckBox(self.groupBox)
        self.cb_architecture.setGeometry(QtCore.QRect(200, 60, 70, 20))
        self.cb_architecture.setText("建筑")
        
        self.cb_animal = QtWidgets.QCheckBox(self.groupBox)
        self.cb_animal.setGeometry(QtCore.QRect(280, 60, 70, 20))
        self.cb_animal.setText("动物")
        
        self.cb_technology = QtWidgets.QCheckBox(self.groupBox)
        self.cb_technology.setGeometry(QtCore.QRect(360, 60, 70, 20))
        self.cb_technology.setText("科技")
        
        # 在分类组框中添加街景摄影复选框（第三行）
        self.cb_street = QtWidgets.QCheckBox(self.groupBox)
        self.cb_street.setGeometry(QtCore.QRect(20, 90, 90, 20))  # 第三行第一个
        self.cb_street.setText("街景摄影")
        
        # 预览区域
        self.preview_label = QtWidgets.QLabel(self.centralwidget)
        self.preview_label.setGeometry(QtCore.QRect(20, 180, 600, 400))
        self.preview_label.setFrameShape(QtWidgets.QFrame.Box)
        self.preview_label.setAlignment(QtCore.Qt.AlignCenter)
        
        # 随机码显示
        self.lbl_random_code = QtWidgets.QLabel(self.centralwidget)
        self.lbl_random_code.setGeometry(QtCore.QRect(20, 560, 300, 20))
        self.lbl_random_code.setText("当前随机码：无")
        
        # 状态显示标签
        self.display_label = QtWidgets.QLabel(self.centralwidget)
        self.display_label.setGeometry(QtCore.QRect(20, 590, 600, 20))
        self.display_label.setStyleSheet("color: #666666;")
        self.display_label.setText("准备就绪")
        self.display_label.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
        
        # 按钮
        self.get_btn = QtWidgets.QPushButton(self.centralwidget)
        self.get_btn.setGeometry(QtCore.QRect(640, 150, 100, 30))
        self.get_btn.setText("随机获取")
        
        self.download_btn = QtWidgets.QPushButton(self.centralwidget)
        self.download_btn.setGeometry(QtCore.QRect(640, 200, 100, 30))
        self.download_btn.setText("下载壁纸")
        
        # 在按钮区域添加设置壁纸按钮
        self.set_wallpaper_btn = QtWidgets.QPushButton(self.centralwidget)
        self.set_wallpaper_btn.setGeometry(QtCore.QRect(640, 250, 100, 30))
        self.set_wallpaper_btn.setText("设为壁纸")
        
        # 在按钮区域上方添加尺寸选择
        self.size_combo = QtWidgets.QComboBox(self.centralwidget)
        self.size_combo.setGeometry(QtCore.QRect(640, 450, 100, 30))
        self.size_combo.addItem("小")
        self.size_combo.addItem("中")
        self.size_combo.addItem("大")
        self.size_combo.addItem("原始")
        
        # 下载尺寸选择组
        self.download_size_group = QtWidgets.QGroupBox(self.centralwidget)
        self.download_size_group.setGeometry(QtCore.QRect(640, 300, 130, 120))
        self.download_size_group.setTitle("下载尺寸")
        
        # 小尺寸复选框
        self.cb_size_small = QtWidgets.QCheckBox(self.download_size_group)
        self.cb_size_small.setGeometry(QtCore.QRect(10, 20, 60, 20))
        self.cb_size_small.setText("小")
        
        # 中尺寸复选框
        self.cb_size_medium = QtWidgets.QCheckBox(self.download_size_group)
        self.cb_size_medium.setGeometry(QtCore.QRect(10, 50, 60, 20))
        self.cb_size_medium.setText("中")
        
        # 大尺寸复选框
        self.cb_size_large = QtWidgets.QCheckBox(self.download_size_group)
        self.cb_size_large.setGeometry(QtCore.QRect(10, 80, 60, 20))
        self.cb_size_large.setText("大")
        
        # 原始尺寸复选框
        self.cb_size_original = QtWidgets.QCheckBox(self.download_size_group)
        self.cb_size_original.setGeometry(QtCore.QRect(10, 110, 60, 20))
        self.cb_size_original.setText("原始")
        
        MainWindow.setCentralWidget(self.centralwidget) 

        # 调整其他按钮位置
        self.get_btn.setGeometry(QtCore.QRect(640, 150, 100, 30))
        self.download_btn.setGeometry(QtCore.QRect(640, 200, 100, 30))
        self.set_wallpaper_btn.setGeometry(QtCore.QRect(640, 250, 100, 30))